import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
const store = new Vuex.Store({
	state: {
		code: uni.getStorageSync("code") || null,
		openid: uni.getStorageSync("openid") || null,
	},
	mutations: {
		SET_CODE(state, code) {
			state.code = code;
			uni.setStorageSync("code", code)
		},
		SET_OPENID(state, openid) {
			state.openid = openid;
			uni.setStorageSync("openid", openid)
		},
	},
	actions: {

	}
})

export default store